<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="/static/m/jsp/include.jsp"%>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,user-scalable=no, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>梦可梦分享</title>
    <link rel="stylesheet" href="${path}/static/m/style/share.css">
    <script>
        var _type = '${type}';
        var _id = '${id}';
        var _num = '${num}'||0;
        $(function () {

           var model = new Vue({
               el:'#share',
               data:{
                   id:_id,
                   type:_type,
                   data:{},
                   num:_num
               },
               methods:{
                   loadData:function () {
                       var that = this;
                       switch (_type){
                           case '1':
                               sy.post(
                                   "/m/info/goods",
                                   {id:_id},
                                   function (data) {
                                       that.data = data;
                                   }
                               )
                               break;
                           case '2':
                               break;
                           case '3':
                               sy.post(
                                   "/m/info/user",
                                   {id:_id},
                                   function (data) {
                                       that.data = data;
                                   }
                               )
                               break;
                       }
                   }
               },
               mounted:function () {
                   this.loadData();
               }
           })
        });
    </script>
</head>
<body>

    <div class="share_box">
        <div class="share_head" id="share">
            <!-- 分享宝贝 -->
             <div class="share_gift share_common" v-if="type==1">
                 <div class="gift_info">
                     <img src="${path}/static/m/images/gift.png" v-sy-img="data.imgLarge">
                     <p class="gift_txt">{{data.name}}<span>x{{num}}</span></p>
                 </div>
             </div>

             <!-- 分享视频 -->
             <div class="share_video share_common" v-else-if="type==2">
                <h2 class="video_title">您的好友在梦可梦分享了一段视频：</h2>
                <video id="video" v-sy-img="id" controls="controls" style="object-fit: fill" webkit-playsinline="true" x-webkit-airplay="true" playsinline="true" x5-video-player-type="h5" x5-video-player-fullscreen="true" width="100%" height="100%" preload="auto"></video>
             </div>

             <!-- 好友分享 -->
             <div class="share_friend share_common" v-else-if="type==3">
                <div class="friend_info">
                    <p>您的好友{{data.nickName}}{{data.account}}</p>
                    <p>邀请您下载注册梦可梦！</p>
                </div>
                <div class="share_logo">
                    <img src="${path}/static/m/images/logo_opacity.png" v-sy-img="data.headImg">
                </div>
             </div>

        </div>
    
        <div class="share_main">
            <img src="${path}/static/m/images/share_main.jpg">
            <div class="share_code">
                <img src="${path}/static/m/images/share_code.jpg">
            </div>
        </div>
    
        <div class="share_btns">
            <a href="#"><img src="${path}/static/m/images/ios_btn.png"></a>
            <a href="#"><img src="${path}/static/m/images/and_btn.png"></a>
        </div>
    </div>
</body>
</html>